package com.shiyingzi.gw.service.impl;


import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.shiyingzi.auser.model.AChannel;
import com.shiyingzi.common.PageUtils;
import com.shiyingzi.common.PageableData;
import com.shiyingzi.gw.dao.NewsMapper;
import com.shiyingzi.gw.model.News;
import com.shiyingzi.gw.service.NewsService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author fanbc
 * @since 2018-05-10
 */
@Service(NewsService.BEAN_ID)
public class NewsServiceImpl extends ServiceImpl<NewsMapper, News> implements NewsService {

	@Override
	public PageableData<News> queryANewsList(int page, int limit, String userName) {
		Page<News> mypage = new Page<News>();
		mypage.setCurrent(page);
		mypage.setSize(limit);
//		AChannel ac =new AChannel();
//		if(!StringUtils.isEmpty(chName)){
//			ac.setChName(chName);
//		}
		
		return PageUtils.tableDataDto(selectPage(mypage,new EntityWrapper<News>().orderBy("createTime")));
	}
//	public PageableData<AChannel> queryANewsList(int page, int limit, String userName);
}
